﻿<UserControl 
    xmlns:local="clr-namespace:Acme.MVVM.IOC"
    x:Class="Acme.MVVM.IOC.SearchView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    mc:Ignorable="d" 
    d:DesignHeight="300" d:DesignWidth="300">
    <Border BorderBrush="LightGray" BorderThickness="1" CornerRadius="10">
        <Grid d:DataContext="{d:DesignInstance {x:Type local:MainWindowViewModel}}" >
            <ListBox x:Name="lbSearchResults" Margin="6" 
                     ItemsSource="{Binding SearchResults}" 
                     SelectedItem="{Binding Path=SearchResultSelectedItem, Mode=TwoWay}">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <DockPanel LastChildFill="True" Width="190">
                            <TextBlock Text="{Binding EventDate, Mode=OneWay, StringFormat=\{0:d\}}" Width="70" />
                            <TextBlock Text="{Binding Title, Mode=OneWay}" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" />
                        </DockPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Grid>
    </Border>
</UserControl>
